import request from '@/utils/request'

// 查询随销收入数据列表
export function listIncome(query) {
  return request({
    url: '/salesIncome/selectIncome',
    method: 'get',
    params: query
  })
}

// 获取区县对应的网格名称
export function getGridName(county) {
  return request({
    url: '/gridManager/getGridName',
    method: 'get',
    params: { county }
  })
}

// 新增随销收入数据
export function addIncome(data) {
  return request({
    url: '/system/income',
    method: 'post',
    data: data
  })
}

// 修改随销收入数据
export function updateIncome(data) {
  return request({
    url: '/system/income',
    method: 'put',
    data: data
  })
}

// 删除随销收入数据
export function delIncome(ids) {
  return request({
    url: `/salesIncome/${ids.join(',')}`,
    method: 'delete'
  })
}

export function uploadFile(params) {
  return request({
    url: '/common/upload',
    method: 'post',
    data: params,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
export function importData(params) {
  return request({
    url: '/salesIncome/import',
    method: 'get',
    params
  })
}
